package cn.mooncode.basketballManage.controller;

import cn.mooncode.basketballManage.service.IUserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @program: basketballManage
 * @description: 上传头像
 * @author: jinweizhi
 * @create: 2021-03-29 16:30
 **/

@RestController
@RequestMapping("/upload")
public class AvatarController {

    @Autowired
    private IUserService userService;

    @ApiOperation(value = "上传头像")
    @PostMapping("/")
    public Object avatar(@RequestParam("file")MultipartFile multipartFile) throws IOException {
        return userService.avatar(multipartFile);
    }
}
